import {pb} from './apiProto'
import {routerReq} from "./routerReq";

export class ProtoBufEncoder {
    lookup(router: string) {
        return !!routerReq[router]
    }

    build(router: string) {
        const apiName = routerReq[router];
        if (pb[apiName]) {
            return pb[apiName];
        }
        console.error('no such router', router);
        return null;
    }
}